<template>
    <div>
        <m-field
            v-for="(item,index) in fieldList"
            :key="index"
            :field="item"
            :disabled="false"
            :value="value"
            @change="onChange"></m-field>
    </div>
</template>

<script>
  import field from '@/components/field/field'
  export default {
    name: "fieldDemo",
    components: {
      "m-field": field
    },
    data(){
      return {
        fieldList: [
          {
            type: 'text',
            placeholder: '文本',
            defaultValue: 'hhh'
          },
          {
            type: 'password',
            placeholder: '密码',
            defaultValue: '789456123'
          },
          {
            type: 'picklist',
            placeholder: '选择',
            options: [
              'okok',
              'ab',
              'cd',
              'ef',
              'gh',
              'ij',
              'kl',
              'mn',
              'op',
              'qr',
              'st',
            ],
            defaultValue: 'ab'
          },
          {
          type: 'picture'
          }

        ],
        field:{
          type: 'text',
          placeholder: '请输入'
        },
        value: ''
      }
    },
    methods: {
      onChange(e){
        console.log(e);
      }
    }
  }
</script>

<style scoped>

</style>
